package com.wuyb.util;

import com.wuyb.pojo.Meeting;
import com.wuyb.pojo.param.MeetingAddParam;
import com.wuyb.pojo.param.MeetingUpdateParam;

/**
 * 会议参数转换工具
 *
 * @Author: wyb
 * @Date: 2024/01/05/14:29
 * @Description:
 */
public class MeetingParamConverter {

    public static Meeting getMeeting(MeetingAddParam meetingAddParam) {
        return Meeting.builder()
                .startDate(meetingAddParam.getStartDate())
                .haveLicence(meetingAddParam.getHaveLicence())
                .name(meetingAddParam.getName())
                .maxNumber(meetingAddParam.getMaxNumber())
                .build();

    }

    public static Meeting getMeeting(MeetingUpdateParam meetingUpdateParam) {
        return Meeting.builder()
                .id(meetingUpdateParam.getId())
                .startDate(meetingUpdateParam.getStartDate())
                .haveLicence(meetingUpdateParam.getHaveLicence())
                .name(meetingUpdateParam.getName())
                .maxNumber(meetingUpdateParam.getMaxNumber())
                .build();
    }
}
